<template>
	<view class="container">
		<view class="item" @click="changePhone">
			<view class="title">修改手机号</view>
			<view class="phone">{{ userInfo.userInfo.phone }}</view>
			<view class="go">
				<image src="https://community.chuangxiangdianli.com/images/loginImg/you.png" mode=""></image>
			</view>
		</view>
		<view class="item" @click="goUs">
			<view class="title">关于我们</view>
			<view class="phone"></view>
			<view class="go">
				<image src="https://community.chuangxiangdianli.com/images/loginImg/you.png" mode=""></image>
			</view>
		</view>
		<!-- <view class="btn" @click="loginOut">
			退出登录
		</view> -->
	</view>
</template>

<script>
	export default{
		data() {
			return{
				userInfo: {},
			}
		},
		onShow() {
			var that = this
			uni.getStorage({
				key: 'userInfo',
				success: (res) => {
					that.userInfo = res.data
					console.log('用户信息', that.userInfo)
				},
				fail: (res) => {
					uni.showToast({
						title: '获取用户信息失败',
						icon: 'none'
					})
				}
			})
		},
		methods:{
			//  跳转到关于我们
			goUs() {
				uni.navigateTo({
					url: '/me/aboutUs/index'
				})
			},
			// 跳转到修改绑定手机号
			changePhone() {
				uni.navigateTo({
					url: '/login/changephone/index'
				})
			},
			//  跳转到修改密码
			changePassword() {
				uni.navigateTo({
					url: '/login/changepassword/index'
				})
			},
			//  退出登录方法
			// loginOut() {
			// 	var that = this
			// 	that.$mrequest({
			// 		url: ''
			// 	})
			// },
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		background-color: rgba(239, 240, 247, 1);
	}
	.item{
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		width: 100%;
		height: 110rpx;
		background-color: #fff;
		padding: 0 30rpx;
		border-top: 2rpx solid rgba(51, 51, 51, .1);
		
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333333;
		.phone{
			flex: 1;
			text-align: right;
		}
		.go{
			width: 40rpx;
			height: 40rpx;
			margin-left: 40rpx;
			&>image{
				display: block;
				height: 100%;
				width: 100%;
			}
		}
	}
	.btn{
		height: 90rpx;
		margin: 300rpx 30rpx 0rpx;
		background: linear-gradient(-74deg, #70DAC4, #3EC4A7);
		border-radius: 45rpx;
		line-height: 90rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		text-align: center;
	}
</style>
